<!-- saved from url=(0013)about:internet -->
   /////////////////////////////////////////////////////////////
   // Identify page as enabled for Media Center. This avoids a warning dialog to user.
   function IsMCEEnabled()
   {
       return true
   }

var nFullScreen = 0
function backFromFullScreen()
{
    if (nFullScreen == 0)
    {
        nFullScreen = 1
        return false
    }
    else return true
}


    
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Set background color for Shared Viewport and MCE toolbars that appear when you move mouse
function setBGColor(Color)
{
    try
    {
        window.external.MediaCenter.BGColor = Color
    }
    catch(e)
    {
        // not using Media Center, or attribute not set
    }
}

    
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// This function tests to see if you need to open a Viewport for media playback
function needViewport()
{
    // if Shared or Custom Viewport is already visible, return false
    if (window.external.MediaCenter.SharedViewPort.Visible == true || window.external.MediaCenter.CustomViewPort.Visible == true)
    {
        return false
    }
    // if there is no media playing, return false
    if(window.external.MediaCenter.Experience.PlayState == -1) return false
    // otherwise return true
    return true
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// This function detects what version of Media Center the user is running. It will return year as string, such as "2005"
function showMCEVersion()
{
    try
    {
        var nMajVer = window.external.MediaCenter.MajorVersion
    }
    catch (e)
    {
        return null
    }
    if (nMajVer < 7) return "2004"
    if (nmajVer = 7) return "2005"
    // in case above fails, return null
    return null
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// This function detects whether user is in a remote session on a Media Center Extender device
// detect whether user is in a remote session on a Media Center Extender device
function IsMCExtender()
{
    try
    {
        // if this is not a console session ...
        if (window.external.MediaCenter.Capabilities.IsConsole == false)
        {
            /* ...then it is either a Media Center Extender session or a traditional Remote Desktop session.
             To tell which type of session it is, check if video is allowed. If video is allowed... */
            if (window.external.MediaCenter.Capabilities.IsVideoAllowed == true)
            {
                // ... then it is an extender session, so return true    
                return true
            }
            // Media Center does not allow video in a traditional Remote Desktop session. So if video is not allowed ...
            else
            {
                /* IsConsole and IsVideoAllowed are both false false, so user is accessing through a traditional Remote 
                Desktop session, rather than from an extender device. That means that they probably have access to a keyboard 
                and mouse, but they cannot play video. If your application features video playback, you may want to 
                adjust your functionality for this user accordingly. 
                Returning false simply indicates that this is not an Extender session.  */     
                return false
            }
        }
        else
        {
            // If not, this is a Media Center session on the console PC, so return false
            return false
        }
    }
    catch(e)
    {
        /* If above cause errors, user is probably accessing from a browser outside of Media Center.
        Return false to indicate that it is not an extender session. */
        return false
    }
}

